home *** CD-ROM | disk | FTP | other *** search
- function HideHandle()
- {
- mcHandle._visible = false;
- }
- function SetValue(val, initializing)
- {
- this.Value = Math.floor(Math.max(0,Math.min(100,val)));
- Tracer.trace("set val=" + val);
- Update();
- if(initializing == false || initializing == undefined)
- {
- if(OnValueChanged != undefined)
- {
- OnValueChanged();
- }
- }
- }
- function Update()
- {
- var _loc1_ = (- mcMask._width) * (100 - Value) / 100;
- var _loc3_ = mcMask._width * Value / 100;
- mcMask._x = _loc1_;
- mcHandle._x = _loc3_;
- var _loc2_ = mcAllocator._visible;
- mcAllocator._visible = false;
- mcAllocator._visible = true;
- mcAllocator._visible = _loc2_;
- }
- var Value;
- var ReadOnly;
- var ShowHandle;
- var OnValueChanged;
- if(ReadOnly == undefined)
- {
- ReadOnly = false;
- }
- if(ShowHandle == undefined)
- {
- ShowHandle = true;
- }
- mcAllocator._visible = false;
- mcHandle._visible = ShowHandle;
- SetValue(Value,true);
- if(!ReadOnly)
- {
- this.hitArea = this;
- this.onPress = function()
- {
- if(!ReadOnly)
- {
- SetValue(100 - (mcHit._width - this._xmouse) * 100 / mcHit._width);
- }
- };
- this.onRollOver = function()
- {
- mcAllocator._visible = true;
- };
- this.onRollOut = function()
- {
- mcAllocator._visible = false;
- };
- }
- mcHit._visible = false;
-